<template>
	<div class="message-list table-theme">
		<head-title title="设置--信息列表"></head-title>
		<el-card>
			<div class="top-menu">
				<div class="menu-left">
					
				</div>

				<div class="menu-right">
					<refresh-button @refresh="refreshPage"></refresh-button>
				</div>
			</div>
			<p class="data-number">总数据数：{{total}}</p>
			<el-table :data="list" border>
				<el-table-column label="序号" align="center" prop="log_id"></el-table-column>
				<el-table-column label="工厂id" align="center" prop="type_id"></el-table-column>
				<el-table-column label="名字" align="center" prop="name"></el-table-column>
				<el-table-column label="工厂名称" align="center" prop="factory_name"></el-table-column>
				<el-table-column label="工厂编号" align="center" prop="factory_sn"></el-table-column>
				<el-table-column label="时间" align="center" prop="add_time"></el-table-column>
			</el-table>
			<div class="pages"><el-pagination background layout="prev, pager, next, jumper" :total="total" @current-change="init" :current-page="page"></el-pagination></div>
		</el-card>

	</div>
</template>

<script>
export default {
	data() {
		return {
			list: [],
			total: 0,totalData: 0, 
			page: 0
		};
	},
	methods: {
		// 初始化列表
		init(e) {
			this.page = e;
			let data = {
				page: e - 1 ? e - 1 : 0,
				limit: 10,
			};

			this.$http(this.$ApiList.TidingsList, data).then(res => {
				this.list = res.datas.data;
				this.total = res.datas.count;
			});
		},
		refreshPage() {
			this.page = 1;
			this.init();
		}
	},
	created() {
		this.init();
	}
};
</script>
<style lang="scss" scoped>
.message-list {
}
</style>
